<template>
  <div>
    <div class="login-box">
      登录页面
      <el-form :rules="rules">
        <el-form-item :model="ruleForm.name" prop="ruleForm.namename">
          <el-input v-model="ruleForm.name"></el-input>
        </el-form-item>
        <el-form-item :model="ruleForm" prop="name">
          <el-input v-model="ruleForm.password" type="password"></el-input>
        </el-form-item>
        <el-form-item>
    <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
    <el-button @click="resetForm('ruleForm')">重置</el-button>
  </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ruleForm: {
        name: "12",
        password: "555",
      },
      rules: {
        name: [
                 { required: true, message: '请输入规范账号', trigger: 'blur' },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
        password: [
                 { required: true, message: '请输入正确密码', trigger: 'blur' },
          { min: 6, max: 8, message: "长度在 6 到 8 个字符", trigger: "blur" },
        ],
      },
    };
  },
};
</script>

<style lang="scss">
body {
  background: #34495e;
  .login-box {
    width: 600px;
    height: 400px;
    background: #fff;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 10px;
  }
}
</style>
